package prassein.rsm.dto;

public class PermLevelDto {
	//1
	private String createResume;
	//100
	private String editResume;
	//1000
	private String deleteResume;
	//10000
	private String surperSearch;
	//100000
	private String createUser;
	//1000000
	private String editUser;
	//10000000
	private String deleteUser;
	//100000000
	private String createXls;
	//1000000000
	private String sysManager;
	
	public String getSysManager() {
		return sysManager;
	}
	public void setSysManager(String sysManager) {
		this.sysManager = sysManager;
	}
	public String getCreateResume() {
		return createResume;
	}
	public void setCreateResume(String createResume) {
		this.createResume = createResume;
	}
	public String getEditResume() {
		return editResume;
	}
	public void setEditResume(String editResume) {
		this.editResume = editResume;
	}
	public String getDeleteResume() {
		return deleteResume;
	}
	public void setDeleteResume(String deleteResume) {
		this.deleteResume = deleteResume;
	}
	public String getSurperSearch() {
		return surperSearch;
	}
	public void setSurperSearch(String surperSearch) {
		this.surperSearch = surperSearch;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public String getEditUser() {
		return editUser;
	}
	public void setEditUser(String editUser) {
		this.editUser = editUser;
	}
	public String getDeleteUser() {
		return deleteUser;
	}
	public void setDeleteUser(String deleteUser) {
		this.deleteUser = deleteUser;
	}
	public String getCreateXls() {
		return createXls;
	}
	public void setCreateXls(String createXls) {
		this.createXls = createXls;
	}
	
	public int getPerm() {
		int perm = 0;
		if (createResume != null && createResume.equalsIgnoreCase("true")) {
			perm += 1;
		} 
		if (createResume != null && createResume.equalsIgnoreCase("true")) {
			perm += 10;
		} 
		if (editResume != null && editResume.equalsIgnoreCase("true")) {
			perm += 100;
		} 
		if (deleteResume != null && deleteResume.equalsIgnoreCase("true")) {
			perm += 1000;
		} 
		if (surperSearch != null && surperSearch.equalsIgnoreCase("true")) {
			perm += 10000;
		} 
		if (createUser != null && createUser.equalsIgnoreCase("true")) {
			perm += 100000;
		} 
		if (editUser != null && editUser.equalsIgnoreCase("true")) {
			perm += 1000000;
		} 
		if (deleteUser != null && deleteUser.equalsIgnoreCase("true")) {
			perm += 10000000;
		}
		if (createXls != null && createXls.equalsIgnoreCase("true")) {
			perm += 100000000;
		}
		if (sysManager != null && sysManager.equalsIgnoreCase("true")) {
			perm += 1000000000;
		}
		return perm;
	}
}
